package com.starleague.battletech.unit.mech;

import java.util.Map;

import com.starleague.battletech.unit.AbstractBattletechUnitComponent;
import com.starleague.battletech.unit.AbstractWeight;

public abstract class AbstractMechGyro
        extends AbstractBattletechUnitComponent
        implements IMechGyro
{
    private MechGyroType gyroType;

    protected AbstractMechGyro(AbstractMech mech,
                               AbstractWeight weight,
                               MechGyroType gyroType)
    {
        super(mech, weight);
        this.gyroType = gyroType;
    }

    @Override
    public AbstractMech getMech()
    {
        return (AbstractMech) this.getBattletechUnit();
    }

    @Override
    public boolean isHittable()
    {
        return true;
    }

    @Override
    public MechGyroType getGyroType()
    {
        return this.gyroType;
    }

    @Override
    public Map<String, Object> infoProperties()
    {
        Map<String, Object> infoPropertyMap = super.infoProperties();
        infoPropertyMap.put("gyroType", this.gyroType);
        return infoPropertyMap;
    }
}
